#ifndef EBNMODELFACTORY_H
#define EBNMODELFACTORY_H

#include <QXmlDefaultHandler>
#include <QtXml>

class CEbnModel;
class CEbnWorldStateManager;
class CEbnActionManager;
class CEbnGoal;
class CEbnReceptor;
class CEbnCompetenceModule;
class CEbnModelController;

class CEbnModelFactory : public QXmlDefaultHandler
{
public:
    explicit CEbnModelFactory(CEbnModelController * controller);
    ~CEbnModelFactory();

    bool loadFile(const QString & filename);

protected:
    bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts);
    bool endElement(const QString &namespaceURI, const QString &localName, const QString &qName);
    bool characters(const QString &ch);
    bool fatalError(const QXmlParseException &exception);

private:
    CEbnModelController * mpController;
    CEbnModel * mpModel;
    CEbnWorldStateManager * mpWorldStateManager;
    CEbnActionManager * mpActionManager;

    CEbnGoal * mpCurrentGoal;
    CEbnCompetenceModule * mpCurrentCompetenceModule;
    CEbnReceptor * mpCurrentReceptor;


};

#endif // EBNMODELFACTORY_H
